﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.models.windows.builders.config.autoclose {
    import flash.events.*;
    import flash.utils.*;

    public class WindowAutoClose extends Timer implements IWindowAutoClose {

        private var onCompleteCallback:Function;

        public function WindowAutoClose(_arg1:Number):void{
            super((_arg1 * 1000), 0);
        }
        public function run(_arg1:Function):void{
            if (super.running){
                return;
            };
            this.onCompleteCallback = _arg1;
            super.addEventListener(TimerEvent.TIMER, this.onComplete);
            super.start();
        }
        public function interrupt():void{
            if (super.running){
                this.reset();
                this.stop();
            };
        }
        private function onComplete(_arg1:TimerEvent):void{
            this.onCompleteCallback();
            this.destroy();
        }
        private function destroy():void{
            this.interrupt();
            super.removeEventListener(TimerEvent.TIMER_COMPLETE, this.onComplete);
            this.onCompleteCallback = null;
        }

    }
}//package net.wooga.pets.models.windows.builders.config.autoclose 
